(function(factory) {
  if (exports && module.exports !== undefined) {
    module.exports = factory();
  } else {
    window.remJs = factory();
  }
})(function() {
  let o = {};
  let options = {
    originalWidth: 750, // 设计稿的原始宽度
  };
  let customOptions;

  let docEl, htmlEl, clientWidth, pixelRatio, remUnit, handler;

  handler = function() {
    clientWidth = docEl.clientWidth;
    pixelRatio = Math.floor(window.devicePixelRatio);
    remUnit = clientWidth * 100 / customOptions.originalWidth
    _log(remUnit);
    htmlEl.style.fontSize = remUnit + "px";
  };

  o.init = function name(opts) {
    docEl = document.documentElement || document.body;
    htmlEl = document.getElementsByTagName("html")[0];
    customOptions = Object.assign({}, options, opts);

    window.addEventListener("resize", handler);
    handler();
  };

  return o;
});
